<?php
abstract class ZendX_Controller_Action extends Zend_Controller_Action
{
    protected $_resources = array();

    protected function _confInit()
    {
    }

    protected function _loadResources(array $names) {
        foreach($names as $name) {
            $this->_loadResource($name);
        }
    }

    protected function _loadResource($name) {
        ZendX_Resource_Manager::getInstance()->getResource($name);
    }

    public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
    {
        $this->setRequest($request)
                ->setResponse($response)
                ->_setInvokeArgs($invokeArgs);
        $this->_helper = new Zend_Controller_Action_HelperBroker($this);
        $this->_confInit();
        if(!empty($this->_resources) && is_array($this->_resources)) {
            $this->_loadResources($this->_resources);
        }
        $this->init();
    }
}